package com.specter.mvc.model.batis;

/**
 * Note:Oracle 数据库方言
 * 
 * @author Liang.Wang
 * @version Mar 16, 2017
 */
public class Dialect4Oracle implements Dialect {

	@Override
	public String limitSQL(String sql, long offset, long limit) {
		String fmt = "SELECT * FROM ( SELECT TMP_.*, ROWNUM ROW_ID FROM ( s% ) TMP WHERE ROWNUM <= s% ) WHERE ROW_ID > s% ";
		return fmt.formatted(sql, (offset + limit), offset);
	}

}
